#!/usr/bin/python
# -*- coding: UTF-8 -*-

import os
import tornado

from controllers.douyin.douyin import DouyinHandler, DouyinContentHandler
from controllers.www.www import MainHandler
from controllers.kuaishou.kuaishou import KuaishouHandler, ContentHandler
from controllers.wechat.wechat import WechatHandler, WeixinContentHandler

settings = {
    "static_path": os.path.join(os.path.dirname(__file__), "static"),
    "template_path": os.path.join(os.path.dirname(__file__), "templates"),
    "cookie_secret": "61oETzKXQAGa23L5gEmGeJJ",
    "debug": True,
}
print(settings)

application = tornado.web.Application([
    (r"/", MainHandler),
    (r"/kuaishou", KuaishouHandler),
    (r'/content', ContentHandler),
    (r"/wechat", WechatHandler),
    (r'/wechat_content', WeixinContentHandler),

    (r'/douyin', DouyinHandler),
    (r'/douyin_content', DouyinContentHandler),

], **settings)


if __name__ == "__main__":
    application.listen(8002)
    tornado.ioloop.IOLoop.instance().start()